Skip to content

fix(cli): detect newer layout for bun global installs to avoid error message of unsupported package manager or layout - #2291

Open
bowenliang123 wants to merge 1 commit into
MoonshotAI:mainfrom
bowenliang123:fix/bun-global-install-detection
Open

fix(cli): detect newer layout for bun global installs to avoid error message of unsupported package manager or layout #2291
bowenliang123 wants to merge 1 commit into
MoonshotAI:mainfrom
bowenliang123:fix/bun-global-install-detection

Conversation

@bowenliang123

@bowenliang123 bowenliang123 commented Jul 28, 2026

Copy link
Copy Markdown

Related Issue

Discovered while investigating a user report that starting the TUI shows "Detected install source: unsupported package manager or layout" for a bun global installation.

Problem

With installed kimi cli via bun with newer bun 1.3.x+ layout, the kimi or kimi update throws warning messages for "Detected install source: unsupported package manager or layout" .

Recent versions of bun install global packages under ~/.bun/node_modules/<pkg> and create a shim in ~/.bun/bin/. Kimi Code's install-source detection only recognized the older ~/.bun/install/global/node_modules/<pkg> layout, so bun global installs were misclassified as unsupported. This caused:

  • The startup warning Detected install source: unsupported package manager or layout.
  • kimi upgrade falling back to a manual npm command instead of using bun add -g.

Both layouts are valid bun global installs and expose the CLI through ~/.bun/bin/:

# Legacy layout expected by the old code
~/.bun/
├── bin/
│   └── kimi -> ../../install/global/node_modules/@moonshot-ai/kimi-code/dist/main.mjs
└── install/global/node_modules/
    └── @moonshot-ai/kimi-code/

# Current layout used by bun 1.3.14+
~/.bun/
├── bin/
│   └── kimi -> ../../node_modules/@moonshot-ai/kimi-code/dist/main.mjs
└── node_modules/
    └── @moonshot-ai/kimi-code/

What changed

  • Updated apps/kimi-code/src/cli/update/source.ts so the bun heuristic matches both the legacy .bun/install/global/ path and the current .bun/node_modules/ path.
  • Added unit tests in apps/kimi-code/test/cli/update/source.test.ts covering the real-world ~/.bun/node_modules/@moonshot-ai/kimi-code layout.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 36214bc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bowenliang123 bowenliang123 changed the title fix(cli): detect bun global installs in ~/.bun/node_modules layout fix(cli): detect bun global installs skipping error messages unsupported package manager or layout Jul 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fb0730078

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/cli/update/source.ts Outdated
@bowenliang123 bowenliang123 changed the title fix(cli): detect bun global installs skipping error messages unsupported package manager or layout fix(cli): detect newer layout for bun global installs skipping error messages unsupported package manager or layout Jul 28, 2026
@bowenliang123
bowenliang123 force-pushed the fix/bun-global-install-detection branch from 9fb0730 to 4dee239 Compare July 28, 2026 03:33
@bowenliang123
bowenliang123 force-pushed the fix/bun-global-install-detection branch from 4dee239 to 36214bc Compare July 28, 2026 03:34
@bowenliang123 bowenliang123 changed the title fix(cli): detect newer layout for bun global installs skipping error messages unsupported package manager or layout fix(cli): detect newer layout for bun global installs to avoid error message of unsupported package manager or layout Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant